<?php
/**
 * RsaConf.php
 * Created by PhpStorm.
 * User: 江小波
 * Date: 2018/8/17
 * Time: 11:07
 */
namespace app\common\utils\rsa;

/**
 * Class RsaConf
 * @package app\common\rsa
 * 做非对称加密时候，经常要生成密钥对，公钥私钥。
 * 一般常用openssl命令行生成，每次操作比较复杂，提供在线工具可以选定生成私钥位数以及私钥密码，可以直接在线生成非对称加密密钥对。
 * 本工具提供pkcs#1格式公私钥对，还有pkcs#8公私钥对。
 * 早期openssl1.0之前版本，一般提供是pkcs#1格式，有很多软件只支持pkcs#1格式（js rsa模块)，那么你可以选择生成该种类型。
 * 现在一般流行是pkcs#8格式。详细可以上网找找，pkcs#1与pkcs#8区别。
 * 有问题欢迎联系！
 */
class RsaConf {
    /**
     * 生成密钥位数： 1024位(bit)
     * 密钥格式：PKCS#1
     * 注意事项：只支持pkcs#1格式（js rsa模块)
     */
    const PRIVATE_KEY = "-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQChXHbhtbQcRKggz8mVsOMiZ0R5yjPhKEXXjAQ667S9Vzx49vYP
CeLBelT/5h30CRB5afs+m3ceWsdMWedOuBJs3sEwYTPtUDWYLYF9D2xwT9FDfPWo
9S6VC7Fu60Hd6hZdRs9b6/3gJaSNq4w35o9iW6j6nAsUtFxV3CdeVHP01wIDAQAB
AoGAM0YnfJd5kRX7+tksLEXWFwOLjcvD6oMalmCmo3Zsq1HCJIoNLEAu7t4Jjns3
/2i19G7J6F4MXvfnpopW5vu01qKdpMoLQW6BS8c5Qzno542Zjuw3pUVjoKRghAp9
lKnXKqaHt/IBEAgap3GH4nftsw/rcTqz383vFRYQMdlwLdECQQDvGKgLKzSQOO2V
wc4L4NhHAFjnElxW1xJqSgSLeEpmzK5RbN0vQSVBmCi8egMwxDj3n7L086ovpj4v
iomWIt5vAkEArMTmTpWBsWLnMMIZje/1uY/xHaTVPdf7sOpqfzzCS2TejFMvPgvb
7p/Kuq/c0W0PPHJlEV/wJQ++lfDnQtWEGQJBAMk2dc0Yah7pWcBLHkzOxxRRjX/A
6ubGDqBWdCavb+W9YQHzXNz0tRbTp4yeHes/ZzW1NxR/rvx0qia2Lv2jkI8CQALI
qW1au1xAW7lNZ1wCIdN7nkb8APOeJ1ASduTV9cuBNJTOQlSdnE2cBYg8jTJSr4wp
y7cb9KKkPk3sM82/4wECQQCRP2F8YsYwJI+ERvN0nODpaE5wEhfZc4mVIKSj1Ezn
C/7cGshkNoZeN5Nfz7VEzARMqa/Ac2Xs54ELwM6xXIjV
-----END RSA PRIVATE KEY-----";
    const PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQChXHbhtbQcRKggz8mVsOMiZ0R5
yjPhKEXXjAQ667S9Vzx49vYPCeLBelT/5h30CRB5afs+m3ceWsdMWedOuBJs3sEw
YTPtUDWYLYF9D2xwT9FDfPWo9S6VC7Fu60Hd6hZdRs9b6/3gJaSNq4w35o9iW6j6
nAsUtFxV3CdeVHP01wIDAQAB
-----END PUBLIC KEY-----";

    /**
     * 生成密钥位数： 1024位(bit)
     * 密钥格式：PKCS#8
     */
    const PRIVATE_KEY_PKCS8 = "-----BEGIN PRIVATE KEY-----
MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAN2DEdemqqYMTq0K
f7iRSsZiXGy+XUSQhwwZj9xgd89CZKAWasUyPg8UDl7++ba477TU1WjOAATTDMDr
gBaiitUioc/Vp+ErIqK2cU0+reLPSBjYLSUfiPQtprffy7dCn8sdnomuogJRl+m8
6ks7zjmqgBCmcQhgmLvd0dbvgEd1AgMBAAECgYEAqUjyyNEpl07OjbX5V+9JqwUe
x0hQdQbS/m9Gn0/mIDIIPsQDAwNbpCBav0SzSG5bWuJQ2hCcuRMlqwYPVL0RxVbd
Og+/IJ3DP2E/n6P6AYA9/lhLGwTb1z9m3wmK0CibF1SP4/ulTU03Z+J95koYZ1IP
+E48FpjG25fWWVFJJUECQQD0yTgmHm1EPC/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